package com.xuetang9.t9.xinhuaxia.service.impl;

import com.xuetang9.t9.xinhuaxia.beans.SocialChat;
import com.xuetang9.t9.xinhuaxia.mappers.SocialChatMapper;
import com.xuetang9.t9.xinhuaxia.service.ISocialChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 陈焱
 * @version 1.0
 * @desc
 * @time 2020/2/26 下午 5:25
 * @copyright liyq
 * @address 成都西部国际金融中心2栋2201
 **/
@Service
public class SocialChatService implements ISocialChatService {

    @Autowired
    private SocialChatMapper socialChatMapper;
    @Override
    public boolean add(SocialChat socialChat) {
        return socialChatMapper.save(socialChat)>0;
    }

    @Override
    public int getChatCountByPublishId(int pid) {
        return socialChatMapper.getChatCountByPid(pid);
    }

    @Override
    public List<SocialChat> queryBypid(Integer pid) {
        return socialChatMapper.queryBypid(pid);
    }
}
